(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    ["pages/homeloadpage"], {
        "2a16": function (e, n, t) {},
        "2dda": function (e, n, t) {
            "use strict";
            (function (e, n) {
                var o = t("4ea4");
                t("c150"), t("5c17"), t("a9ff");
                o(t("66fd"));
                var i = o(t("f184"));
                e.__webpack_require_UNI_MP_PLUGIN__ = t, n(i.default)
            }).call(this, t("bc2e")["default"], t("543d")["createPage"])
        },
        "77c2": function (e, n, t) {
            "use strict";
            var o = t("2a16"),
                i = t.n(o);
            i.a
        },
        ce6d: function (e, n, t) {
            "use strict";
            (function (e) {
                var o = t("4ea4");
                Object.defineProperty(n, "__esModule", {
                    value: !0
                }), n.default = void 0;
                var i = o(t("3da5")),
                    s = {
                        data: function () {
                            return {
                                url: getApp().globalData.apiurl,
                                loading: !0,
                                src: "/static/icon/logo.png",
                                phoneState: !1,
                                loginForm: {
                                    username: "",
                                    password: ""
                                },
                                thisCID: ""
                            }
                        },
                        methods: {
                            imageSuccess: function (e) {},
                            imageError: function (e) {
                                console.error("image发生error事件，携带值为" + e.detail.errMsg)
                            },
                            getJurisdiction: function () {
                                wx.login({
                                    success: res => {
                                        getApp().globalData.WXCODE = res.code
                                    },
                                    error: err => {
                                        console.log("请从新登录小程序")
                                    }
                                })
                                // e.navigateTo({
                                //     url: "/pages/wxLogin"
                                // });
                                // e.navigateTo({
                                //     url: "/pages/login"
                                // });

                                return this.handleCIDLogin();

                                var n = e.getSystemInfoSync().platform;
                                "android" == n ? (i.default.requestAndroidPermission("android.permission.WRITE_EXTERNAL_STORAGE"), i.default.requestAndroidPermission("android.permission.INTERNET"), i.default.requestAndroidPermission("android.permission.WRITE_SETTINGS")) : "ios" == n && i.default.judgeIosPermission("push"), this.handleCIDLogin()
                            },
                            handleCIDLogin: function () {
                                var n = this;
                                e.getPushClientId({
                                    success: function (e) {
                                        n.thisCID = e.cid
                                        getApp().globalData.WXLOGINCID = e.cid

                                        //console.log("存储cid", getApp().globalData.WXLOGINCID)
                                    },
                                    fail: function (e) {
                                        console.log(e)
                                    },
                                    complete: function () {
                                        // console.log("获取当前用户的cid：" + n.thisCID);
                                        n.selectCID(n.thisCID)
                                    }
                                })
                            },
                            selectCID: function (n) {
                                var t = this;
                                e.request({
                                    url: this.url + "appLoginRedis/getAccountInfo",
                                    method: "GET",
                                    data: {
                                        equipmentCID: n
                                    },
                                    success: function (res) {
                                        var o = res.data;
                                        //console.log('加载首页', o)
                                        if (404 == o.stateApp) {
                                            e.navigateTo({
                                                url: "/pages/login"
                                            });
                                        } else {
                                            t.loginForm.username = o.accountNumber;
                                            t.loginForm.password = o.accountPassword;
                                            t.submitForm()
                                        }
                                    },
                                    fail: function () {
                                        console.log("请求失败！"), e.navigateTo({
                                            url: "/pages/login"
                                        })
                                    },
                                    complete: function () {
                                        console.log("请求结束")
                                    }
                                })
                            },
                            submitForm: function () {
                                var n = this;
                                e.request({
                                    url: this.url + "login",
                                    method: "POST",
                                    data: {
                                        username: this.loginForm.username,
                                        password: this.loginForm.password
                                    },
                                    success: function (t) { 
                                        if(t.data.code==500){
                                            wx.showToast({
                                                title: '登录验证已过期',
                                                icon: 'error',
                                                duration: 1000
                                            })

                                             setTimeout((function () { 
                                                wx.navigateTo({
                                                    url: "/pages/login"
                                                })
                                            }), 1000) 
                                        }
                                        var o = n.loginForm.username;
                                        null != t.data.token && e.request({
                                            url: n.url + "apiunattended/apiunattended/getUserInfo",
                                            method: "GET",
                                            data: {
                                                username: o
                                            },
                                            success: function (n) {
                                                getApp().globalData.userinfo = n.data;
                                                e.getStorageSync("key");
                                                setTimeout((function () {
                                                    e.switchTab({
                                                        url: "/pages/main/index?users=".concat(o)
                                                    })
                                                }), 1e3)
                                            },
                                            fail: function () {
                                                console.log("请求失败！")
                                            },
                                            complete: function () {
                                                e.getPushClientId({
                                                    success: function (n) {
                                                        var t = n.cid;
                                                        e.request({
                                                            url: getApp().globalData.apiurl + "zrwjMessage/setCID",
                                                            method: "GET",
                                                            data: {
                                                                userKEY: getApp().globalData.userinfo.nickName,
                                                                messCID: t
                                                            }
                                                        })
                                                    },
                                                    fail: function (e) {
                                                        console.log(e)
                                                    }
                                                })
                                            }
                                        })
                                    },
                                    fail: function () {},
                                    complete: function () {
                                        n.insertCID()
                                    }
                                })
                            },
                            insertCID: function () {
                                //console.log("执行添加用户信息函数", this.thisCID), 
                                null != this.thisCID && e.request({
                                    url: this.url + "appLoginRedis/setAccountInfo",
                                    method: "GET",
                                    data: {
                                        equipmentCID: this.thisCID,
                                        accountNumber: this.loginForm.username,
                                        accountPassword: this.loginForm.password
                                    }
                                })
                            }
                        },
                        onLoad: function () {
                            //console.log("加载首页")
                        },
                        onReady: function () {
                            //console.log("索取用户权限"), 
                            this.getJurisdiction()
                        }
                    };
                n.default = s
            }).call(this, t("543d")["default"])
        },
        dfae: function (e, n, t) {
            "use strict";
            t.r(n);
            var o = t("ce6d"),
                i = t.n(o);
            for (var s in o)["default"].indexOf(s) < 0 && function (e) {
                t.d(n, e, (function () {
                    return o[e]
                }))
            }(s);
            n["default"] = i.a
        },
        f184: function (e, n, t) {
            "use strict";
            t.r(n);
            var o = t("fe57"),
                i = t("dfae");
            for (var s in i)["default"].indexOf(s) < 0 && function (e) {
                t.d(n, e, (function () {
                    return i[e]
                }))
            }(s);
            t("77c2");
            var a = t("f0c5"),
                u = Object(a["a"])(i["default"], o["b"], o["c"], !1, null, null, null, !1, o["a"], void 0);
            n["default"] = u.exports
        },
        fe57: function (e, n, t) {
            "use strict";
            t.d(n, "b", (function () {
                return o
            })), t.d(n, "c", (function () {
                return i
            })), t.d(n, "a", (function () {}));
            var o = function () {
                    var e = this.$createElement;
                    this._self._c
                },
                i = []
        }
    },
    [
        ["2dda", "common/runtime", "common/vendor"]
    ]
]);